package org.example.reference;
/**
 * 强引用测试
 * @author youshang
 * @date 2022/03/31 01:56
 **/
public class StrongReferenceTest {

    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer();
        StringBuffer sb1 = sb;

        sb = null;
        System.gc();

        try {
            Thread.sleep(100000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(sb1);
    }
}
